<?php

/**
 * Varstring form base class.
 *
 * @method Varstring getObject() Returns the current form's model object
 *
 * @package    seth
 * @subpackage form
 * @author     Fuz
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseVarstringForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'dev'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Powerdev'), 'add_empty' => false)),
      'sampletime' => new sfWidgetFormDateTime(),
      'source'     => new sfWidgetFormInputText(),
      'sourceid'   => new sfWidgetFormInputText(),
      'vdc'        => new sfWidgetFormInputText(),
      'idc'        => new sfWidgetFormInputText(),
      'idc1'       => new sfWidgetFormInputText(),
      'idc2'       => new sfWidgetFormInputText(),
      'idc3'       => new sfWidgetFormInputText(),
      'idc4'       => new sfWidgetFormInputText(),
      'idc5'       => new sfWidgetFormInputText(),
      'idc6'       => new sfWidgetFormInputText(),
      'idc7'       => new sfWidgetFormInputText(),
      'idc8'       => new sfWidgetFormInputText(),
      'idc9'       => new sfWidgetFormInputText(),
      'idc10'      => new sfWidgetFormInputText(),
      'idc11'      => new sfWidgetFormInputText(),
      'idc12'      => new sfWidgetFormInputText(),
      'idc13'      => new sfWidgetFormInputText(),
      'idc14'      => new sfWidgetFormInputText(),
      'idc15'      => new sfWidgetFormInputText(),
      'idc16'      => new sfWidgetFormInputText(),
      'idc17'      => new sfWidgetFormInputText(),
      'idc18'      => new sfWidgetFormInputText(),
      'state1'     => new sfWidgetFormInputText(),
      'state2'     => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'dev'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Powerdev'))),
      'sampletime' => new sfValidatorDateTime(),
      'source'     => new sfValidatorString(array('max_length' => 255)),
      'sourceid'   => new sfValidatorInteger(),
      'vdc'        => new sfValidatorNumber(array('required' => false)),
      'idc'        => new sfValidatorNumber(array('required' => false)),
      'idc1'       => new sfValidatorNumber(array('required' => false)),
      'idc2'       => new sfValidatorNumber(array('required' => false)),
      'idc3'       => new sfValidatorNumber(array('required' => false)),
      'idc4'       => new sfValidatorNumber(array('required' => false)),
      'idc5'       => new sfValidatorNumber(array('required' => false)),
      'idc6'       => new sfValidatorNumber(array('required' => false)),
      'idc7'       => new sfValidatorNumber(array('required' => false)),
      'idc8'       => new sfValidatorNumber(array('required' => false)),
      'idc9'       => new sfValidatorNumber(array('required' => false)),
      'idc10'      => new sfValidatorNumber(array('required' => false)),
      'idc11'      => new sfValidatorNumber(array('required' => false)),
      'idc12'      => new sfValidatorNumber(array('required' => false)),
      'idc13'      => new sfValidatorNumber(array('required' => false)),
      'idc14'      => new sfValidatorNumber(array('required' => false)),
      'idc15'      => new sfValidatorNumber(array('required' => false)),
      'idc16'      => new sfValidatorNumber(array('required' => false)),
      'idc17'      => new sfValidatorNumber(array('required' => false)),
      'idc18'      => new sfValidatorNumber(array('required' => false)),
      'state1'     => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'state2'     => new sfValidatorString(array('max_length' => 45, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('varstring[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Varstring';
  }

}
